pub mod buf;
pub mod cfg;
pub mod ground;
pub mod pair;
pub mod queue;
pub mod selbox;
pub mod task;

use super::{
    err, err_value, json, ok, throw_err, Base, Client, ECode, Lock, MapSv, RNull, Resp, VBase,
    VMap, VRece, VSend, Value, VecV,
};
use base::tbase::TBase;
use std::collections::HashMap;

pub use queue::queue_job;

pub type MSV = HashMap<String, Vec<Value>>;

pub async fn doit(
    para: &Value,
    cmd: &str,
    key: &str,
    client: &Client,
    tx: VSend,
    lock: Lock,
) -> Resp {
    match cmd {
        "pair" => {
            let v = pair::Pair;
            v.do_cmd(para, key, client, tx, lock).await
        }
        _ => throw_err!(ECode::NoServe, "no cmd"),
    }
}
